import { HTTP } from '../utils/httpRequestUtil'
import URL from './api'
export default {
  sriGainAwardsLoadByPaging (params, cb) {
    HTTP.post(URL.sriGainAwardsLoadByPaging, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainAwardsSave (params, cb) {
    HTTP.post(URL.sriGainAwardsSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainAwardsGet (params, cb) {
    HTTP.post(URL.sriGainAwardsGet, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainAwardsDel (params, cb) {
    HTTP.post(URL.sriGainAwardsDel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
    //成果管理===科技奖===导入excel
    sriGainAwardsImport (fileObj, cb) {
      const formData = new FormData()
      formData.append(fileObj.filename, fileObj.file)
      for (let k in fileObj.param) { // 设置参数
        formData.append(`${k}`, fileObj.param[`${k}`])
      }
      return HTTP.request({
        url: URL.sriGainAwardsImport,
        headers: {
          'enctype': 'multipart/form-data',
          'custom-printDebugInfo': 'Y'
        },
        method: 'post',
        data: formData,
      }).then(function (response) {
        cb(response.data)
        // fileObj.onProgress({ percent: 100 })
      }).catch(function (error) {
        cb(error.response)
      })
    },
  //调试科研创新管理===成果管理===科技奖==导出excel
  sriGainAwardsExport (params, cb) {
    HTTP.post(URL.sriGainAwardsExport, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainTopicLoadByPaging (params, cb) {
    HTTP.post(URL.sriGainTopicLoadByPaging, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainTopicGet (params, cb) {
    HTTP.post(URL.sriGainTopicGet, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainTopicSave (params, cb) {
    HTTP.post(URL.sriGainTopicSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //调试科研创新管理===成果管理===科研课题===导出excel
  sriGainTopicExport (params, cb) {
    HTTP.post(URL.sriGainTopicExport, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainTopicDel (params, cb) {
    HTTP.post(URL.sriGainTopicDel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //成果管理===科研课题===导入excel
  sriGainTopicImport (fileObj, cb) {
    const formData = new FormData()
    formData.append(fileObj.filename, fileObj.file)
    for (let k in fileObj.param) { // 设置参数
      formData.append(`${k}`, fileObj.param[`${k}`])
    }
    return HTTP.request({
      url: URL.sriGainTopicImport,
      headers: {
        'enctype': 'multipart/form-data',
        'custom-printDebugInfo': 'Y'
      },
      method: 'post',
      data: formData,
    }).then(function (response) {
      cb(response.data)
      // fileObj.onProgress({ percent: 100 })
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainStandardLoadByPaging (params, cb) {
    HTTP.post(URL.sriGainStandardLoadByPaging, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainStandardGet (params, cb) {
    HTTP.post(URL.sriGainStandardGet, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainStandardSave (params, cb) {
    HTTP.post(URL.sriGainStandardSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
    //调试科研创新管理===成果管理===标准===导出excel
    sriGainStandardExport (params, cb) {
      HTTP.post(URL.sriGainStandardExport, params).then(function (response) {
        cb(response.data)
      }).catch(function (error) {
        cb(error.response)
      })
    },
    //=成果管理===标准===导入excel
    sriGainStandardImport (fileObj, cb) {
      const formData = new FormData()
      formData.append(fileObj.filename, fileObj.file)
      for (let k in fileObj.param) { // 设置参数
        formData.append(`${k}`, fileObj.param[`${k}`])
      }
      return HTTP.request({
        url: URL.sriGainStandardImport,
        headers: {
          'enctype': 'multipart/form-data',
          'custom-printDebugInfo': 'Y'
        },
        method: 'post',
        data: formData,
      }).then(function (response) {
        cb(response.data)
        // fileObj.onProgress({ percent: 100 })
      }).catch(function (error) {
        cb(error.response)
      })
    },
  sriGainStandardDel (params, cb) {
    HTTP.post(URL.sriGainStandardDel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //调试科研创新管理===成果管理===能力建设===导出excel
  sriGainCapBuildExport (params, cb) {
    HTTP.post(URL.sriGainCapBuildExport, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //=成果管理===能力建设===导入excel
  sriGainCapBuildImport (fileObj, cb) {
    const formData = new FormData()
    formData.append(fileObj.filename, fileObj.file)
    for (let k in fileObj.param) { // 设置参数
      formData.append(`${k}`, fileObj.param[`${k}`])
    }
    return HTTP.request({
      url: URL.sriGainCapBuildImport,
      headers: {
        'enctype': 'multipart/form-data',
        'custom-printDebugInfo': 'Y'
      },
      method: 'post',
      data: formData,
    }).then(function (response) {
      cb(response.data)
      // fileObj.onProgress({ percent: 100 })
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainCapBuildLoadByPaging (params, cb) {
    HTTP.post(URL.sriGainCapBuildLoadByPaging, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainCapBuildGet (params, cb) {
    HTTP.post(URL.sriGainCapBuildGet, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainCapBuildSave (params, cb) {
    HTTP.post(URL.sriGainCapBuildSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainCapBuildDel (params, cb) {
    HTTP.post(URL.sriGainCapBuildDel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainYoungSpecialLoadByPaging (params, cb) {
    HTTP.post(URL.sriGainYoungSpecialLoadByPaging, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainYoungSpecialGet (params, cb) {
    HTTP.post(URL.sriGainYoungSpecialGet, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainYoungSpecialSave (params, cb) {
    HTTP.post(URL.sriGainYoungSpecialSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainYoungSpecialDel (params, cb) {
    HTTP.post(URL.sriGainYoungSpecialDel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
    //调试科研创新管理===成果管理===青年专项===导出excel
    sriGainYoungSpecialExport (params, cb) {
      HTTP.post(URL.sriGainYoungSpecialExport, params).then(function (response) {
        cb(response.data)
      }).catch(function (error) {
        cb(error.response)
      })
    },
  //=成果管理===青年专项===导入excel
  sriGainYoungSpecialImport (fileObj, cb) {
    const formData = new FormData()
    formData.append(fileObj.filename, fileObj.file)
    for (let k in fileObj.param) { // 设置参数
      formData.append(`${k}`, fileObj.param[`${k}`])
    }
    return HTTP.request({
      url: URL.sriGainYoungSpecialImport,
      headers: {
        'enctype': 'multipart/form-data',
        'custom-printDebugInfo': 'Y'
      },
      method: 'post',
      data: formData,
    }).then(function (response) {
      cb(response.data)
      // fileObj.onProgress({ percent: 100 })
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainIprLoadByPaging (params, cb) {
    HTTP.post(URL.sriGainIprLoadByPaging, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainIprGet (params, cb) {
    HTTP.post(URL.sriGainIprGet, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainIprSave (params, cb) {
    HTTP.post(URL.sriGainIprSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  sriGainIprDel (params, cb) {
    HTTP.post(URL.sriGainIprDel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //调试科研创新管理===成果管理===知识产权===导出excel
  sriGainIprExport (params, cb) {
    HTTP.post(URL.sriGainIprExport, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //=成果管理===知识产权===导入excel
  sriGainIprImport (fileObj, cb) {
    const formData = new FormData()
    formData.append(fileObj.filename, fileObj.file)
    for (let k in fileObj.param) { // 设置参数
      formData.append(`${k}`, fileObj.param[`${k}`])
    }
    return HTTP.request({
      url: URL.sriGainIprImport,
      headers: {
        'enctype': 'multipart/form-data',
        'custom-printDebugInfo': 'Y'
      },
      method: 'post',
      data: formData,
    }).then(function (response) {
      cb(response.data)
      // fileObj.onProgress({ percent: 100 })
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //论文管理列表
  sriGainPaperList (params, cb) {
    HTTP.post(URL.sriGainPaperList, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //论文新增或发起变更
  sriGainSavePaper (params, cb) {
    HTTP.post(URL.sriGainSavePaper, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  // //论文新增或发起变更
  // sriGainSavePaper (params, cb) {
  //   HTTP.post(URL.sriGainSavePaper, params).then(function (response) {
  //     cb(response.data)
  //   }).catch(function (error) {
  //     cb(error.response)
  //   })
  // },
  // 论文-审批（提交/驳回）
  sriGainPaperSubmitProcess (params, cb) {
    HTTP.post(URL.sriGainPaperSubmitProcess, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },

   //论文-查看详情
   sriGainPaperInfo (params, cb) {
    HTTP.post(URL.sriGainPaperInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },

  //论文列表导出
  sriGainPaperExportExcel (params, cb) {
    HTTP.post(URL.sriGainPaperExportExcel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },

  //能力建设年度计划列表
  sriGainCapacityBuildingPlanList (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingPlanList, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //获取往后3年年份
  sriGainGetNextThreeYear (params, cb) {
    HTTP.post(URL.sriGainGetNextThreeYear, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //能建-计划详情
  sriGainCapacityBuildingPlanInfo (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingPlanInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //获取所有能建计划
  sriGainCapacityBuildingGetAllPlanInfo (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingGetAllPlanInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //阶段详情
  sriGainCapacityBuildingPlanStageInfo (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingPlanStageInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //根据计划id获取阶段
  sriGainCapacityBuildingPlanGetPhaseByPlanId (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingPlanGetPhaseByPlanId, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //能建计划新增（开启流程，新增或变更）
  sriGainCapacityBuildingPlanSave (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingPlanSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //能建计划审批
  sriGainCapacityBuildingPlanSubmitProcess (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingPlanSubmitProcess, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //阶段进展提交（开启流程）
  sriGainCapacityBuildingPlanStageSave (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingPlanStageSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //阶段进展流程审批
  sriGainCapacityBuildingPlanStageSubmitProcess (params, cb) {
    HTTP.post(URL.sriGainCapacityBuildingPlanStageSubmitProcess, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //获取所有能力建设年份
  sriGainGetCapacityBuildingGetAllYear (params, cb) {
    HTTP.post(URL.sriGainGetCapacityBuildingGetAllYear, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  // 能建-进展详情
  sriGainGetCapacityBuildingGetPlanProgressInfo (params, cb) {
    HTTP.post(URL.sriGainGetCapacityBuildingGetPlanProgressInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  // 能建-列表导出
  sriGainGetCapacityBuildingExportExcel (params, cb) {
    HTTP.post(URL.sriGainGetCapacityBuildingExportExcel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //实验室年度计划列表
  sriGainLaboratoryAnnualPlanList (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualPlanList, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
   //实验室年度计划详情
   sriGainLaboratoryAnnualPlanInfo (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualPlanInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
   //实验室年度计划提交（新增/变更/关闭）
   sriGainLaboratoryAnnualPlanSave (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualPlanSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
   //实验室年度计划审批
   sriGainLaboratoryAnnualSubmitProcess (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualSubmitProcess, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
   //实验室获取所有计划
   sriGainLaboratoryAnnualGetAllPlanInfo (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualGetAllPlanInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
   //根据计划获取阶段-实验室
   sriGainLaboratoryAnnualGetPhaseByPlanId (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualGetPhaseByPlanId, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
   //实验室 - 阶段详情
   sriGainLaboratoryAnnualStageInfo (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualStageInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //实验室 - 获取计划所有年度
  sriGainLaboratoryAnnualGetAllYear (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualGetAllYear, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  // 实验室计划进展提交（开启流程）
  sriGainLaboratoryAnnualPlanStageSave (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualPlanStageSave, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  // 实验室进展流程审批（提交或回退）
  sriGainLaboratoryAnnualPlanStageSubmitProcess (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualPlanStageSubmitProcess, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  // 实验室进展详情
  sriGainLaboratoryAnnualProgressInfo (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualProgressInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //实验室 - 列表导出
  sriGainLaboratoryAnnualExportExcel (params, cb) {
    HTTP.post(URL.sriGainLaboratoryAnnualExportExcel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },

  //预算-列表
  sriGainBudgetList (params, cb) {
    HTTP.post(URL.sriGainBudgetList, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //预算明细-列表
  sriGainBudgetItemList (params, cb) {
    HTTP.post(URL.sriGainBudgetItemList, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //新增年度预算
  sriGainBudgetAdd (params, cb) {
    HTTP.post(URL.sriGainBudgetAdd, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //编辑年度预算
  sriGainBudgetUpdate (params, cb) {
    HTTP.post(URL.sriGainBudgetUpdate, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //年度预算详情
  sriGainBudgetInfo (params, cb) {
    HTTP.post(URL.sriGainBudgetInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //明细导出
  sriGainBudgetItemExportExcel (params, cb) {
    HTTP.post(URL.sriGainBudgetItemExportExcel, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
  //获取所有预算年份
  sriGainGetBudgetGetAllYear (params, cb) {
    HTTP.post(URL.sriGainGetBudgetGetAllYear, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },
    //明细导出
    sriGainBudExportExcel (params, cb) {
      HTTP.post(URL.sriGainBudExportExcel, params).then(function (response) {
        cb(response.data)
      }).catch(function (error) {
        cb(error.response)
      })
    },
   //预算申请（提交流程）
   sriGainSaveBudgetItem (params, cb) {
    HTTP.post(URL.sriGainSaveBudgetItem, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },

  // 预算审批（提交或驳回）
  sriGainBudgetItemSubmitProcess (params, cb) {
    HTTP.post(URL.sriGainBudgetItemSubmitProcess, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },

  // 预算详情
  sriGainBudgetItemInfo (params, cb) {
    HTTP.post(URL.sriGainBudgetItemInfo, params).then(function (response) {
      cb(response.data)
    }).catch(function (error) {
      cb(error.response)
    })
  },


}
